package com.stock;

import java.io.File;
import java.util.Date;
import java.util.List;

import com.dalin.common.utils.DateUtils;
import com.dalin.common.utils.StringUtils;
import com.dalin.common.utils.TextUtils;

public class StockProp {
	private Integer stockId;
	private String code;
	private String name;
	private String date;
	private Double open;
	private Double high;
	private Double low;
	private Double value;
	private Double close;
	private Double limitUp;
	private Double increase;
	private Long volume;
    
	public StockProp() {
		super();
	}
	
	public StockProp(String s) {
		super();
		String[] ary = s.split(",");
		this.date = ary[0];
		this.open = Double.parseDouble(ary[1]);
		this.high = Double.parseDouble(ary[2]);
		this.low = Double.parseDouble(ary[3]);
		this.close = Double.parseDouble(ary[4]);
		this.volume = Long.parseLong(ary[5]);
	}

	public Double getIncrease() {
		//return (double) (Math.round((close / open -1)*10000)/100.0);
		return this.increase;
	}
	public Double getAmplitude () { // 振幅
		return (double) (Math.round((high - low) /open*10000)/100.0);
	}
	public String printInfo() {
		return low+"";
	}
	
	public Double getOpenIncrease(StockProp sp0) { // 开盘价上涨率
		return (double) (Math.round((this.open / sp0.getOpen()  -1)*10000)/100.0);
	}
	public Double getHighIncrease(StockProp sp0) { // 最高价上涨率
		return (double) (Math.round((this.high / sp0.getHigh()  -1)*10000)/100.0);
	}
	public Double getLowIncrease(StockProp sp0) { // 最低价上涨率
		return (double) (Math.round((this.low / sp0.getLow()  -1)*10000)/100.0);
	}
	public String printIncreaseInfo(StockProp sp0) { // 所有参数上涨率
		return this.date+": ";
	}
	
	
	
	
	
	public void setIncrease(Double increase) {
		this.increase = increase;
	}

	public String getDate() {
		return date;
	}

	public Double getOpen() {
		return open;
	}

	public Double getHigh() {
		return high;
	}

	public Double getLow() {
		return low;
	}

	public Double getClose() {
		return close;
	}

	public Long getVolume() {
		return volume;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public void setOpen(Double open) {
		this.open = open;
	}

	public void setHigh(Double high) {
		this.high = high;
	}

	public void setLow(Double low) {
		this.low = low;
	}

	public void setClose(Double close) {
		this.close = close;
	}

	public void setVolume(Long volume) {
		this.volume = volume;
	}

	public Integer getStockId() {
		return stockId;
	}

	public void setStockId(Integer stockId) {
		this.stockId = stockId;
	}

	public Double getLimitUp() {
		return limitUp;
	}

	public void setLimitUp(Double limitUp) {
		this.limitUp = limitUp;
	}

	public Double getValue() {
		return value;
	}

	public void setValue(Double value) {
		this.value = value;
	}
}
